using System;
using System.Data;
using System.Data.Odbc;
using System.Configuration;
using System.Collections;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class public_html_Info : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string Myconn = ConfigurationManager.ConnectionStrings["reviewer"].ConnectionString;
        int TypeText = int.Parse(Request.QueryString["id"]);

        OdbcConnection dbconn = new OdbcConnection(Myconn);
        OdbcCommand myCommand = new OdbcCommand();

        dbconn.Open();

        myCommand.Connection = dbconn;
        myCommand.CommandType = CommandType.Text;
        myCommand.CommandText = "SELECT * FROM `glo_texts` WHERE ID = " + TypeText;

        OdbcDataReader MyReader = myCommand.ExecuteReader();

        MyReader.Read();

        switch (TypeText)
        {
            case 1:
                lblOverskrift.Text = "Om Reviewer.dk";
                break;
            case 2:
                lblOverskrift.Text = "Redaktionen";
                break;
            case 3:
                lblOverskrift.Text = "Ophavsret";
                break;
            default:
                lblOverskrift.Text = "Ingen tekst valgt";
                break;
        }
        
        lblTekst.Text = Regex.Replace(MyReader[1].ToString(), Environment.NewLine, "<br />");

        dbconn.Close();
    }
}
